package org.jeecg.modules.demo.project.service.impl;

import org.jeecg.modules.demo.project.entity.PjProject;
import org.jeecg.modules.demo.project.mapper.PjProjectMapper;
import org.jeecg.modules.demo.project.service.IPjProjectService;
import org.jeecg.modules.demo.pubuyorder.entity.PuBuyOrder;
import org.jeecg.modules.demo.soSaleOrder.entity.SoSaleOrder;
import org.jeecg.modules.demo.yxtraderdata.entity.YxTraderData;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: pj_project
 * @Author: jeecg-boot
 * @Date:   2021-12-15
 * @Version: V1.0
 */
@Service
public class PjProjectServiceImpl extends ServiceImpl<PjProjectMapper, PjProject> implements IPjProjectService {

    @Resource
    private PjProjectMapper pjProjectMapper;

    @Override
    public List<PuBuyOrder> getPuOrderByPjId(String str){
        return pjProjectMapper.getPuOrderByPjId(str);
    }

    @Override
    public List<SoSaleOrder> getSoSaleOrderByPjId(String str){
        return pjProjectMapper.getSoSaleOrderByPjId(str);
    }

    @Override
    public List<PjProject> getPjProject(){
        return pjProjectMapper.getPjProject();
    }

    @Override
    public boolean revertLogicDeletedPjProject(List<String> projectIds) {
        String ids = String.format("'%s'", String.join("','", projectIds));
        return pjProjectMapper.revertLogicDeletedPjProject(ids) > 0;
    }
}
